<?php
include 'dbc.php';
$query="select id,iron_stock,base_iron from towns";
$result=mysql_query($query,$con) or DIE(mysql_error());
while ($row=mysql_fetch_array($result))
{
$newiron=$row['iron_stock']+$row['base_iron'];
$id=$row['id'];
$query2="update towns set iron_stock='$newiron' where id='$id'";
mysql_query($query2,$con) or Die (mysql_error()); 
}
mysql_close();
?>